<html>
<head>
    <title>用户注册</title>
</head>
<body>
<form action="">
    用户名：<input type="text" name="username" >
    密码：<input type="password" name="password">
    确认密码：<input type="password" name="re_password">
    <input type="submit" value="注册">
</form>
</body>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script>
    jQuery(function() {
        jQuery('form').submit(function () {
            jQuery.post('/index.php?c=user&a=doRegister', jQuery('form').serialize(), function(data){
                if (data.status == 0) {
                    alert(data.message)
                } else {
                    window.location.href = '/index.php?c=user&a=login'
                }
            }, 'json')
            return false;
        })
    })
</script>
</html>